<div class="order-list-page" ng-if="pagedata.op == 'list'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">商户抢单</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content order-list' style="top:0">
		<div style="padding:0.3rem">
		<div class="tips tips-yellow">
			<i class="fa fa-bullhorn"></i> [<red>温馨提示</red>]：{{pagedata.tips}}
		</div>
		</div>
		<div class='jy-content'>
		<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
                    <div ng-repeat="g in item.goods" class="fui-list goods-list">
                            <div class="fui-list-media" style="">
                                <img class="" ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}"/>
                            </div>
                            <div class="fui-list-inner">
                                <div class="text goodstitle towline">{{g.title || '商品名称'}}</div>
								<div class="text goodstitle">规格：{{g.selespename || '无'}}</div>
                            </div>
                            <div class="fui-list-angle" style="width:3rem">
                                ￥<span class="marketprice">**.**</span>
							</div>
                    </div>
					<div class="title" style="padding:0 0.5rem">
						<div><i class="icon icon-trade" style="font-size: 0.65rem"> 商品总价：<span class="price red">￥**.**</span></i></div>
						<div><i class="icon icon-trade" style="font-size: 0.65rem"> 实际收款：<span class="red">￥**.**</span></i></div>
						<div class="subtitle"><i class="icon icon-shijian" style="font-size: 0.65rem">下单时间：{{item.createtime}}</i></div>
					</div>
					<div class="fui-list">
                        <div class="fui-list-inner">
							<div><i class="icon icon-tianmaosonghuoshangmen" style="font-size: 0.65rem"> 送货类型：<span class="red">{{item.sendtypetitle}}</span></i></div>
							<span style="color:#999;font-size:0.65rem"><i class="icon icon-ditu"></i> 收货地址： <span class="text-danger">{{item.order_out.pcd.city}} {{item.order_out.pcd.district}} {{item.order_out.pcd.street}} {{item.order_out.address}}</span></span>
						</div>
					</div>
					<div class="fui-list-group-title lineblock opblock">
						<span class="status noremark">
							<div class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="post({},'//getorder/','id='+item.id)">接收订单</div>
						</span>
					</div>
        </div>
		 </div>
	</div>
	<div class="content-empty" ng-show="pagedata.list.length == 0 ">
		  <i class="icon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">暂时没有订单可抢！</p>
	</div>
</div>
<div class="order-list-page" ng-if="pagedata.op == 'detail'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">订单详情</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page'>
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div class="fui-list-inner">
					<div class="title" style="font-size:0.65rem">昵称：{{pagedata.member.nickname}}</div>
                </div>
                <a class="jump" href="javascript:;">
					
				</a>
            </div>
		</div>
		<div class="weui_cells">
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>用户姓名</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.address">{{pagedata.order.name}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>联系电话</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.address">{{pagedata.order.mobile}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>用户地址</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.address">{{pagedata.order.order_out.pcd.city}} {{pagedata.order.order_out.pcd.district}} {{pagedata.order.order_out.pcd.street}} {{pagedata.order.order_out.address}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>备注</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.remark">{{pagedata.order.remark}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>商品总价</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_price">{{pagedata.order.goods_price}}元</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>实际支付</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_price">{{pagedata.order.price}}元</div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('merch/_footer')"></div>
<div class="fe-floatright-bottom" style="bottom:5rem">
<a ng-if="pagedata.isopenvoice==1" ng-click="pagedata.isopenvoice=2;pagedata.openvoice(false)" href="javascript:;"><i class="icon icon-nolingsheng0"></i></a>
<a ng-if="pagedata.isopenvoice!=1" ng-click="pagedata.isopenvoice=1;pagedata.openvoice(true)" href="javascript:;"><i class="icon icon-lingsheng0"></i></a> 
</div>
<audio id="openvoice" controls preload="auto" style="display:none;">
	<source src="../core/resource/images/neworder.mp3"></source>
</audio>
<script>
scope.tool.get_list('jy_liangoods/merch.peisong_order/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_liangoods/merch.peisong_order/list/');
}
scope.pagedata.openvoice=function(type){
	var voicetime = {};
    var openvoice;
	if(type || scope.pagedata.isopenvoice==1){
		 openvoice = setInterval(() => {
			if(scope.pagedata.isopenvoice!=1){
				clearInterval(openvoice);
				return false;
			}
			scope.get('jy_liangoods/merch.index/getnew/',function(res){
						console.log('openvoice');console.log(res);
						if(res!='none'){
							if(!voicetime[res.id]){
								voicetime[res.id]=1;
								$("#openvoice")[0].play();
							}
							if(scope.pagedata.status==2){
								scope.tool.get_list('jy_liangoods/merch.worker_order/list/status='+scope.pagedata.status,true);
							}
						}
			});
		}, 5000);
	}else{
		scope.get('jy_liangoods/merch.index/setopenvoice/isopenvoice=0',function(res){});
	}
}
scope.pagedata.openvoice();
</script>